local wdtxSlashSkill = fk.CreateSkill {
  name = "wdtx__slash_skill",
}

local skill = Fk.skills["slash_skill"] --[[ @as ActiveSkill ]]

wdtxSlashSkill:addEffect("cardskill", {
  prompt = function(self, player, selected_cards)
    local card = Fk:cloneCard("wdtx__slash")
    card:addSubcards(selected_cards)
    local max_num = self:getMaxTargetNum(player, card)
    if max_num > 1 then
      local num = #table.filter(Fk:currentRoom().alive_players, function (p)
        return p ~= player and not player:isProhibited(p, card)
      end)
      max_num = math.min(num, max_num)
    end
    card.subcards = {}
    return max_num > 1 and "#wdtx__slash_skill_multi:::" .. max_num or "#wdtx__slash_skill"
  end,
  max_phase_use_time = 1,
  target_num = 1,
  can_use = skill.canUse,
  mod_target_filter = skill.modTargetFilter,
  target_filter = skill.targetFilter,
  on_effect = function(self, room, effect)
    local extra_add = 0
    if room.logic.class.name == "wdtx_logic" then
      extra_add = effect.card:getMark("@up_damage")
    end
    local from = effect.from
    local to = effect.to
    if not to.dead then
      room:damage({
        from = from,
        to = to,
        card = effect.card,
        damage = 1 + extra_add,
        damageType = fk.NormalDamage,
        skillName = wdtxSlashSkill.name
      })
    end
  end
})


return wdtxSlashSkill